import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { SharedModule } from 'src/app/shared/shared.module';


import { SettingComponent } from './pages/setting.component';
import { EmailConfigComponent } from './pages/email-config/email-config.component';
import { EmailConfigTabComponent } from './pages/email-config/email-config-tab/email-config-tab.component';
import { EmailSendTabComponent } from './pages/email-config/email-send-tab/email-send-tab.component';
import { IdapConfigComponent } from './pages/idap-config/idap-config.component';
import { UserTokenComponent } from './pages/user-token/user-token.component';

const routes: Routes = [
  {
    // 一级路由
    path: '', component: SettingComponent,
    children: [
      {
        path: '', component: EmailConfigComponent,
      },
      {
        path: 'email-config', component: EmailConfigComponent,
      },
      {
        path: 'idap-config', component: IdapConfigComponent
      },
      {
        path: 'user-token', component: UserTokenComponent
      }
    ]
  },
];

@NgModule({
  // 在模版中，声明组件
  declarations: [
    SettingComponent,
    EmailConfigComponent,
    EmailConfigTabComponent,
    EmailSendTabComponent,
    IdapConfigComponent,
    UserTokenComponent],
  // 导入路由配置和共享模版
  imports: [RouterModule.forChild(routes),
    SharedModule,
  ],
  exports: [],
  entryComponents: [
    EmailConfigTabComponent,
    EmailSendTabComponent,
    IdapConfigComponent
  ],
  providers: [],
})
export class SettingModule { }
